package com.sskj.xgja.verify;

import com.sskj.base.data.User;
import com.sskj.base.utils.RxUtils;
import com.sskj.xgja.BasePresenter;
import com.sskj.xgja.api.Api;
import com.sskj.xgja.api.ApiObserver;


/**
 * @author Hey
 * Create at  2019/03/20
 */
class Verify4Presenter extends BasePresenter<Verify4Activity> {
    public void getAccountDetail(String account, boolean showLoading) {
        Api.getInstance().accountDetail()
                .compose(RxUtils.transform())
                .subscribe(new ApiObserver<User>(this, showLoading) {
                    @Override
                    public void onSuccess(User data) {
                        mView.setAccountInfo(data);
                    }
                });
    }

    // 拒绝原因
    public void getReason(boolean showLoading) {
        Api.getInstance().getReason()
                .compose(RxUtils.transform())
                .subscribe(new ApiObserver<String>(this, showLoading) {
                    @Override
                    public void onSuccess(String data) {
                        mView.updateUi(data);
                    }
                });
    }
}
